<template>
  <div class="simple-home">
    <div class="container">
      <h1>🎉 应用正常运行</h1>
      <p>如果您能看到这个页面，说明应用已经成功启动！</p>
      
      <div class="status-info">
        <div class="status-item">
          <span class="label">当前时间：</span>
          <span class="value">{{ currentTime }}</span>
        </div>
        <div class="status-item">
          <span class="label">页面状态：</span>
          <span class="value success">✅ 正常</span>
        </div>
        <div class="status-item">
          <span class="label">Vue 版本：</span>
          <span class="value">{{ vueVersion }}</span>
        </div>
      </div>
      
      <div class="navigation-links">
        <h2>系统入口</h2>
        <div class="link-grid">
          <router-link to="/teacher/dashboard" class="nav-link teacher">
            <div class="link-icon">👨‍🏫</div>
            <div class="link-content">
              <h3>教师系统</h3>
              <p>进入教师管理界面</p>
            </div>
          </router-link>

          <router-link to="/student/dashboard" class="nav-link student">
            <div class="link-icon">👨‍🎓</div>
            <div class="link-content">
              <h3>学生系统</h3>
              <p>进入学生学习界面</p>
            </div>
          </router-link>
        </div>
      </div>

    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue'
import { version } from 'vue'

const currentTime = ref('')
const vueVersion = ref(version)

let timeInterval: number

onMounted(() => {
  updateTime()
  timeInterval = setInterval(updateTime, 1000)

  console.log('SimpleHome 组件已挂载')
})

onUnmounted(() => {
  if (timeInterval) {
    clearInterval(timeInterval)
  }
})

const updateTime = () => {
  currentTime.value = new Date().toLocaleString('zh-CN')
}
</script>

<style scoped>
.simple-home {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 10px;
  font-size: 2.5em;
}

p {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
  font-size: 1.1em;
}

.status-info {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.status-item:last-child {
  border-bottom: none;
}

.label {
  font-weight: 500;
  color: #333;
}

.value {
  font-family: monospace;
  color: #666;
}

.value.success {
  color: #28a745;
  font-weight: 500;
}

.navigation-links h2 {
  color: #333;
  margin-bottom: 20px;
  border-bottom: 2px solid #409EFF;
  padding-bottom: 10px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.nav-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.nav-link.teacher:hover {
  border-color: #409EFF;
}

.nav-link.student:hover {
  border-color: #67C23A;
}



.link-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.link-content h3 {
  margin: 0 0 5px 0;
  color: #333;
}

.link-content p {
  margin: 0;
  color: #666;
  font-size: 0.9em;
  text-align: left;
}


</style>
